<?php

use think\facade\Route;

//用户相关
Route::group('admin',function(){
    //注册路由
    Route::post('register','api/zmt/Admin/register');
    //登录
    Route::post('login','api/zmt/Admin/login');
    //验证码
    Route::post('code','api/zmt/Admin/sendSmsCode');
    //用户信息列表
    Route::get('list','api/zmt/Admin/AdminList');
    //用户信息增加
    Route::post('add','api/zmt/Admin/AdminAdd');
    //修改用户信息
    Route::post('edit','api/zmt/Admin/AdminEdit');
    //本地图片上传
    Route::post('upload','api/zmt/Upload/upload');
    //个人信息图片上传
    Route::post('image','api/zmt/Upload/image');
    //充值余额
    Route::post('addMoney','api/zmt/Wallet/addMoney');

})->middleware(\api\zmt\middleware\CheckToken::class);
//主页
Route::group('banner',function() {
    //轮播图列表
    Route::get('index', 'api/zmt/Banner/index');
});

Route::group('nav',function() {
    //分类列表
    Route::get('index', 'api/zmt/Nav/index');
});
//收货信息
Route::group('delivery',function() {
    //查询收货地址列表
    Route::get('list', 'api/zmt/Delivery/DeliveryList');
    //添加收货地址
    Route::post('add', 'api/zmt/Delivery/addDelivery');
    //修改收货地址
    Route::post('edit', 'api/zmt/Delivery/editDelivery');
    //删除收货地址
    Route::post('delete', 'api/zmt/Delivery/deleteDelivery');
})->middleware(\api\zmt\middleware\CheckToken::class);
//订单相关
Route::group('order',function (){
    //商品支付购买
    Route::post('create-order','api/zmt/Order/order');
    //商品支付信息
    Route::post('pay','api/zmt/Pay/walletPay');
    //获取商品信息
    Route::get('list','api/zmt/Order/getGoodsList');
    //获取商品详情
    Route::get('info','api/zmt/Order/info');
    //快递物流
    Route::post('wuliu','api/zmt/Order/wuliu');
})->middleware(\api\zmt\middleware\CheckToken::class);